package com.xsmart.goods.dao.wx;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 微信商品分类查询
 * @author guojd
 */
@Component
public interface WxGoodsCategoryDao {
    /**
     * 查询商品分类
     * @param parentId 父类id
     * @return 分类列表
     */
    @Select("<script>SELECT cat_id id,cat_name name,parent_id as tid,'' bz_1 FROM category WHERE cat_sts=1 <if test=\"parentId==null\">and parent_id=1</if><if test=\"parentId!=null\">and parent_id=#{parentId}</if></script>")
    List<Map<String, Object>> queryGoodsCategory(@Param("parentId") Long parentId);
}
